﻿using Furion;
using Furion.DataEncryption;
using Furion.DynamicApiController;
using Furion.EventBus;
using Htx.Fur.Application.System.Dtos;
using Htx.Fur.Core.Entities;
using Htx.Fur.Core.Options;
using Mapster;
using Microsoft.AspNetCore.Authorization;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace Htx.Fur.Application
{
    public class AuthAppService : IDynamicApiController
    {
        public AuthAppService()
        {

        }

        public object GetToken()
        {
            var accessToken = JWTEncryption.Encrypt(new Dictionary<string, object>()
            {
                { "UserId", "sunxiaoshuang" },      // 存储Id
                { "Account", "孙小双" },            // 存储用户名
            });
            return accessToken;
        }

        [Authorize]
        public DateTime GetTime()
        {
            return DateTime.Now;
        }

    }
}
